<layout name='layout' />

<div class="admin-main">
	<blockquote class="layui-elem-quote">
		<a href="<{:U('Album/index')}>" class="layui-btn layui-btn-small">
			<i class="layui-icon">&#xe608;</i> 返回列表
		</a>
	</blockquote>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		<legend>编辑相册</legend>
	</fieldset>

	<form id="ajaxForm" class="layui-form" method="post" action="<{:U('Album/edit')}>">
		<div class="layui-form-item">
			<label class="layui-form-label">标题</label>
			<div class="layui-input-block">
				<input type="text" name="title" lay-verify="required" placeholder="请输入标题" class="layui-input" value="<{$list['title']}>">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">短标题</label>
			<div class="layui-input-block">
				<input type="text" name="short" placeholder="短标题" class="layui-input" value="<{$list['short']}>">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">分类</label>
			<div class="layui-input-block">
				<select name="cid" id="cid" lay-verify="required">
		    	<option value="">==请选择==</option>
		        <volist name="clist" id="vo">
		        <option value="<{$vo['id']}>,<{$vo['path']}>"><php>
		            for($i=0; $i<$vo['count']*2; $i++){
		               echo '&nbsp;&nbsp;';            
		            }
		        </php><{$vo['name']}></option>
		        </volist>
		        </select>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">缩略图</label>
			<div class="layui-inline">
				<img class="thumb" id="picname_src" src="<empty name="list.picname"><{:STATICS}>/image/image.jpg<else/><{$list.picname}></empty>" />
				<input type="hidden" name="picname" id="picname_url" value="<{$list.picname}>"/>								
			</div>
			<div class="layui-inline">
				<input type="button" value="上传" class="layui-btn layui-btn-small" onclick="uploadfile('<{:U('Upload/image')}>','picname');" />
				<input type="button" value="删除图片" class="layui-btn layui-btn-small" onclick="delImage('picname')"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">属性</label>
			<div class="layui-input-block">
				<input type="checkbox" name="flash" value="1" title="幻灯" <php>if($list['flash']==='1')echo checked;</php>>
				<input type="checkbox" name="comm" value="1" title="推荐" <php>if($list['comm']==='1')echo checked;</php>>
				<input type="checkbox" name="top" value="1" title="置顶" <php>if($list['top']==='1')echo checked;</php>>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">发布日期</label>
				<div class="layui-input-inline">
					<input type="text" name="createTime" value="<{$list['createTime']|date='Y-m-d',###}>" lay-verify="date" placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input" />
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">来源</label>
				<div class="layui-input-block">
					<input type="text" name="from" autocomplete="off" class="layui-input" value="<{$list['from']}>"/>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">作者</label>
				<div class="layui-input-block">
					<input type="text" name="author" autocomplete="off" class="layui-input" value="<{$list['author']}>" />
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">关键词</label>
			<div class="layui-input-block">
				<input type="text" name="keyword" class="layui-input" value="<{$list['keyword']}>">
			</div>
		</div>	

		<div class="layui-form-item">
			<label class="layui-form-label">排序</label>
			<div class="layui-input-block">
				<input type="text" name="sort" id="sort" value="<{$list['sort']}>" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">描述</label>
			<div class="layui-input-block">
				<textarea name="intr" class="layui-textarea"><{$list.intr}></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
			</div>
		</div>
		<input type="hidden" name="id" value="<{$list['id']}>" />
		<input type="hidden" name="status" id="status" value="1">
	</form>
</div>
<!--上传文件-->
<form style="display:none;" id='myupload' action="" method='post' enctype='multipart/form-data'>
<input id="fileupload" type="file" name="file">
</form>
<div id="uploading" style="display:none;">
	<div class="wrapper">
		<div class="load-bar">   
			<div class="load-bar-inner" data-loading="0"> <span id="counter">0%</span> </div> 
		</div>  
		<p>请等待... </p>
	</div>
</div>
<script>
$("#cid").val("<{$list['cid']}>,<{$list['path']}>");
$("#tempBtn").click(function(){
	$("#status").val("0");
	$("#ajaxForm").submit();
});
</script>